{include file='common/_meta' /}
<body>
<div class="container">

	<form class="layui-form" action="" lay-filter="form" id="form-article">

		<div class="layui-row">
		  	<div class="layui-form-item layui-col-sm6">
		    	<label class="layui-form-label">用户登录名：</label>
		    	<div class="layui-input-block">
			     	<input type="text" value="" placeholder="{$list.username}" autocomplete="off" class="layui-input" disabled>
		    	</div>
		 	</div>
	 	</div>

 	  	<div class="layui-row">
		  	<div class="layui-form-item layui-form-text layui-col-sm6">
		  	    <label class="layui-form-label">描述：</label>
		  	    <div class="layui-input-block">
		  	      	<textarea name="mark" value="" placeholder="说点什么...100个字符以内" class="layui-textarea" lay-verify="mark"></textarea>
		  	    </div>
		  	 </div>
	 	</div>

		<div class="layui-row">
		  	<div class="layui-form-item">
			    <div class="layui-input-block">
			    	<input type="hidden" name="usid" value="{$usid}">
			     	<button class="layui-btn" lay-submit lay-filter="formDemo">提交</button>
			    </div>
		  	</div>
	  	</div>

	</form>

</div>
{include file="common/_footer"}

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">
layui.use(['layer', 'form'], function() {

	var layer = layui.layer;
	var form  = layui.form;

	form.val("form", {
	  	"admin_relate": "{$list.relate_id}"
	  	,"mark": "{$list.mark_up}"
	})

	form.verify({

		mark: [/^[\S]{0,100}$/,'最大输入100个字符']
	});

	//监听提交
	form.on('submit(formDemo)', function(data) {

		$.ajax({
		    type : "POST",
		    url  : "{:url('Channel/userEdit')}",
		    data : $("#form-article").serialize(),
		    success : function(data) {

	            if(data.code == 0) {

	                layer.msg('编辑成功',{icon:6,time:1000},function(){layer.open({type: 3});parent.location.reload();});
	            } else {

	                layer.msg(data.msg, {icon: 5,time:5000});
	            }

		    },
		    error : function(e) {

		        layer.msg('编辑错误', {icon: 5,time:3000});
		    }
		});

		return false;
	});

});
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>